package com.yeyks.order.dal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeyks.common.appcommon.dto.account.AppIndexDTO;
import com.yeyks.common.dto.HotelStatementResultDTO;
import com.yeyks.common.result.OrderHeadDownLoadResult;
import com.yeyks.common.result.StatisticalHotelResult;
import com.yeyks.common.result.StatisticalResult;
import com.yeyks.common.result.order.UserOrderResult;
import com.yeyks.common.result.screen.DataScreenCityOrderResult;
import com.yeyks.common.result.screen.DataScreenSyncNameResult;
import com.yeyks.order.dal.domain.OrderHead;
import com.yeyks.order.param.OrderHeadOrderListParam;
import com.yeyks.order.vo.OrderHeadOrderListVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
public interface OrderHeadMapper extends BaseMapper<OrderHead> {

    List<OrderHeadOrderListVo> orderList(@Param("param") OrderHeadOrderListParam param);

    List<OrderHead> myList(Map<String, Object> map);

    /**
     * 根据Map的相关条件查询订单列表
     *
     * @param map 条件参数
     * @return 返回集合
     */
    List<OrderHead> selectPageByMap(Map<String, Object> map);

    List<OrderHeadDownLoadResult> selectDownloadOrder(Map<String, Object> paramMap);

    List<OrderHeadDownLoadResult> selectDownloadCNOrder(Map<String, Object> paramMap);

    StatisticalResult statFee(Map<String, Object> map);

    List<StatisticalResult> statMonthAndDay(Map<String, Object> map);

    List<StatisticalHotelResult> statHotelMonthAndDay(Map<String, Object> map);

    /**
     * 根据一定条件统计订单数据(月，天)
     *
     * @param queryMap 查询的条件
     * @return 返回结果
     */
    List<AppIndexDTO> selectDataStat(Map<String, Object> queryMap);

    List<HotelStatementResultDTO> listStatement(Map<String, Object> map);

    /**
     * admin-app 酒店的查询对账单
     *
     * @param queryMap 查询参数
     * @return 返回集合信息
     */
    List<AppIndexDTO> selectHotelDataStat(Map<String, Object> queryMap);

    UserOrderResult selectUserTotalAmount(@Param(value = "userId") Integer userId, @Param(value = "vipFlag") Integer vipFlag);

    List<DataScreenCityOrderResult> statCityOrder();

    List<DataScreenSyncNameResult> syncProvinceName();

    List<DataScreenSyncNameResult> syncCityName();

    int selectOrderPayUserCount();

    void updateProvinceName(@Param(value = "provinceName") String provinceName, @Param(value = "provinceAgentId") Integer provinceAgentId);

    void updateCityName(@Param(value = "cityName") String cityName, @Param(value = "cityAgentId") Integer cityAgentId);

    List<OrderHead> selectPeriodListHotel(Map<String, Object> paramMap);

    void updateInvoiceIsNull(@Param(value = "orderNo") String orderNo);
}
